<template>
	<view class="my-container">
		<!-- 用户信息区域 -->
		<view class="user-info-section">
			<!-- 顶部栏：签到和设置 -->
			<view class="top-actions">
				<view class="sign-in-btn">
					<up-icon name="checkmark-circle" size="18" color="#ffffff"></up-icon>
					<text>签到</text>
				</view>
				<view class="setting-btn">
					<up-icon name="setting" size="20" color="#ffffff"></up-icon>
				</view>
			</view>
			
			<view class="user-profile">
				<!-- 头像和名称在同一行 -->
				<view class="profile-header">
					<view class="user-avatar">
						<image src="/static/user-img.jpg" mode="aspectFill"></image>
						<view class="avatar-badge"></view>
					</view>
					<view class="name-container">
						<view class="user-name">不必理会</view>
						<view class="user-id">ID: 8888888</view>
					</view>
					<view class="vip-tag">
						<up-icon name="level" size="12" color="#ffaa00"></up-icon>
						<text>VIP</text>
					</view>
				</view>
				
				<!-- 用户统计数据 -->
				<view class="user-stats">
					<view class="stat-item">
						<view class="stat-num">256</view>
						<view class="stat-text">
							<up-icon name="thumb-up" size="14" color="#909399"></up-icon>
							<text>点赞</text>
						</view>
					</view>
					<view class="stat-item">
						<view class="stat-num">68</view>
						<view class="stat-text">
							<up-icon name="heart" size="14" color="#909399"></up-icon>
							<text>喜欢</text>
						</view>
					</view>
					<view class="stat-item">
						<view class="stat-num">1024</view>
						<view class="stat-text">
							<up-icon name="eye" size="14" color="#909399"></up-icon>
							<text>浏览</text>
						</view>
					</view>
					<view class="stat-item">
						<view class="stat-num">32</view>
						<view class="stat-text">
							<up-icon name="star" size="14" color="#909399"></up-icon>
							<text>收藏</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 功能列表 -->
		<view class="function-list">
			<!-- 个人信息 -->
			<view class="function-item" @click="navigateTo('./personal-info')">
				<view class="item-left">
					<view class="icon-wrapper blue">
						<up-icon name="star-fill" size="22" color="#ffffff"></up-icon>
					</view>
					<text class="item-text">每日灵感</text>
				</view>
				<up-icon name="arrow-right" size="16" color="#c0c4cc"></up-icon>
			</view>
			
			<!-- 我的收藏 -->
			<view class="function-item" @click="navigateTo('./my-collection')">
				<view class="item-left">
					<view class="icon-wrapper orange">
						<up-icon name="bookmark" size="22" color="#ffffff"></up-icon>
					</view>
					<text class="item-text">我的收藏</text>
				</view>
				<up-icon name="arrow-right" size="16" color="#c0c4cc"></up-icon>
			</view>
			
			<!-- 用户反馈 -->
			<view class="function-item" @click="navigateTo('./feedback')">
				<view class="item-left">
					<view class="icon-wrapper green">
						<up-icon name="chat" size="22" color="#ffffff"></up-icon>
					</view>
					<text class="item-text">用户反馈</text>
				</view>
				<up-icon name="arrow-right" size="16" color="#c0c4cc"></up-icon>
			</view>
			
			<!-- 我的邮件 -->
			<view class="function-item" @click="navigateTo('./mail')">
				<view class="item-left">
					<view class="icon-wrapper brown">
						<up-icon name="email" size="22" color="#ffffff"></up-icon>
					</view>
					<text class="item-text">我的邮件</text>
				</view>
				<up-icon name="arrow-right" size="16" color="#c0c4cc"></up-icon>
			</view>
			
			<!-- 分享有礼 -->
			<view class="function-item" @click="navigateTo('./share-gift')">
				<view class="item-left">
					<view class="icon-wrapper red">
						<up-icon name="gift" size="22" color="#ffffff"></up-icon>
					</view>
					<text class="item-text">分享有礼</text>
				</view>
				<up-icon name="arrow-right" size="16" color="#c0c4cc"></up-icon>
			</view>
		</view>
		
		<!-- 推荐服务 -->
		<view class="recommend-section">
			<view class="section-title">推荐服务</view>
			<view class="service-grid">
				<view class="service-item">
					<up-icon name="rmb-circle" size="30" color="#3c9cff"></up-icon>
					<text>余额查询</text>
				</view>
				<view class="service-item">
					<up-icon name="coupon" size="30" color="#ff9900"></up-icon>
					<text>优惠券</text>
				</view>
				<view class="service-item">
					<up-icon name="kefu-ermai" size="30" color="#19be6b"></up-icon>
					<text>客服咨询</text>
				</view>
				<view class="service-item">
					<up-icon name="map" size="30" color="#fa3534"></up-icon>
					<text>收货地址</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref, reactive } from 'vue';
	import { onLoad } from '@dcloudio/uni-app'
	
	onLoad(() => {


	})
	
	// 页面跳转函数
	const navigateTo = (url) => {
		uni.navigateTo({
			url: url
		});
	};
</script>

<style lang="scss">
.my-container {
	min-height: 100vh;
	background-color: #f8f9fc;
	padding-bottom: 40rpx;
}

/* 用户信息区域样式 */
.user-info-section {
	background: linear-gradient(to bottom, #4393ff, rgba(67, 147, 255, 0));
	padding: 30rpx 30rpx 100rpx;
	box-sizing: border-box;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	height: 220rpx; /* 减小高度 */
	position: relative;
}

/* 顶部签到和设置 */
.top-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20rpx;
}

.sign-in-btn {
	display: flex;
	align-items: center;
	background-color: rgba(255, 255, 255, 0.15);
	padding: 6rpx 18rpx;
	border-radius: 28rpx;
	backdrop-filter: blur(5px);
	
	text {
		color: #ffffff;
		font-size: 24rpx;
		margin-left: 6rpx;
	}
}

.setting-btn {
	width: 56rpx;
	height: 56rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(255, 255, 255, 0.15);
	border-radius: 50%;
	backdrop-filter: blur(5px);
}

.user-profile {
	background-color: #ffffff;
	border-radius: 20rpx;
	padding: 30rpx;
	box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.06);
	margin-top: 20rpx;
	transform: translateY(30rpx); /* 减少下移距离 */
	position: relative;
	z-index: 1;
	margin-bottom: 100rpx; /* 增加底部间距 */
}

.profile-header {
	display: flex;
	align-items: center;
	padding-bottom: 34rpx;
	border-bottom: 1rpx solid #f5f7fa;
	position: relative;
}

.user-avatar {
	width: 120rpx;
	height: 120rpx;
	border-radius: 50%;
	overflow: hidden;
	border: 4rpx solid rgba(67, 147, 255, 0.2);
	box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.08);
	position: relative;
	
	image {
		width: 100%;
		height: 100%;
	}
	
	.avatar-badge {
		position: absolute;
		right: 6rpx;
		bottom: 6rpx;
		width: 18rpx;
		height: 18rpx;
		border-radius: 50%;
		background-color: #19be6b;
		border: 3rpx solid #ffffff;
	}
}

.name-container {
	margin-left: 26rpx;
	flex: 1;
}

.user-name {
	font-size: 36rpx;
	color: #303133;
	font-weight: 600;
}

.user-id {
	font-size: 24rpx;
	color: #909399;
	margin-top: 8rpx;
}

.vip-tag {
	display: flex;
	align-items: center;
	background-color: #fffaeb;
	padding: 4rpx 12rpx;
	border-radius: 20rpx;
	border: 1px solid #ffe6a0;
	
	text {
		font-size: 20rpx;
		color: #ffaa00;
		font-weight: 500;
		margin-left: 4rpx;
	}
}

/* 用户统计数据样式 */
.user-stats {
	display: flex;
	justify-content: space-between;
	padding-top: 34rpx;
}

.stat-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
}

.stat-num {
	font-size: 32rpx;
	color: #303133;
	font-weight: 600;
	line-height: 1.2;
}

.stat-text {
	display: flex;
	align-items: center;
	margin-top: 10rpx;
	font-size: 24rpx;
	color: #909399;
	
	text {
		margin-left: 4rpx;
	}
}

/* 功能列表样式 */
.function-list {
	background-color: #ffffff;
	border-radius: 20rpx;
	margin: 300rpx 30rpx 30rpx; /* 进一步增加顶部边距 */
	padding: 10rpx 0;
	box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.04);
	position: relative;
	z-index: 0;
}

.function-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 30rpx;
	border-bottom: 1rpx solid #f5f7fa;
	
	&:last-child {
		border-bottom: none;
	}
	
	&:active {
		background-color: #f5f7fa;
	}
}

.item-left {
	display: flex;
	align-items: center;
}

.icon-wrapper {
	width: 70rpx;
	height: 70rpx;
	border-radius: 16rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	
	&.blue {
		background: linear-gradient(135deg, #4393ff, #2979ff);
	}
	
	&.orange {
		background: linear-gradient(135deg, #ffb347, #ff9900);
	}
	
	&.green {
		background: linear-gradient(135deg, #44d7b6, #19be6b);
	}
	
	&.brown {
		background: linear-gradient(135deg, #b48c64, #9a6e3a);
	}
	
	&.red {
		background: linear-gradient(135deg, #ff6b6b, #fa3534);
	}
}

.item-text {
	margin-left: 24rpx;
	font-size: 30rpx;
	color: #303133;
}

/* 推荐服务样式 */
.recommend-section {
	background-color: #ffffff;
	border-radius: 20rpx;
	margin: 30rpx;
	padding: 30rpx;
	box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.04);
}

.section-title {
	font-size: 30rpx;
	color: #303133;
	font-weight: 600;
	margin-bottom: 30rpx;
}

.service-grid {
	display: flex;
	flex-wrap: wrap;
}

.service-item {
	width: 25%;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 20rpx;
	
	text {
		margin-top: 12rpx;
		font-size: 24rpx;
		color: #606266;
	}
}
</style>